'''
def validate_age(age_str):
    """Returns true if the string contains a valid age over 18"""
    if not age_str.isdigit():  
        return False
    age = int(age_str)  
    if age < 18 or age > 120:  
        return False
    return True  

print(validate_age("18"))
print(validate_age("34"))
print(validate_age("120"))
print(validate_age.__doc__)
'''
'''
def check_punctuation(sentence):
    """Returns true if the string ends with a valid punctuation mark."""
    sentence = sentence.strip()  
    valid_punctuations = ['?', '.', '!']  
    if sentence:  
        if sentence[-1] in valid_punctuations:
            return True
        else:
            return False
    else: 
        return False

print(check_punctuation("Is this a question?     "))
print(check_punctuation("It sure is!     "))
print(check_punctuation("Okay, I'm done now.     "))
'''
def check_phone_number(phone_number):
    """Checks a string for being a valid phone number"""
    allowed_char = "0123456789 ()"
    count = 0
    for ch in phone_number:
        if ch not in allowed_char:
            return False
        if ch.isdigit():
            count += 1
    if count >= 7:  
        return True
    else:
        return False

print(check_phone_number("(03) 1234567"))
print(check_phone_number("1234567"))
print(check_phone_number("1234567890"))
print(check_phone_number(" 123456 "))
print(check_phone_number("(03) 1234"))
print(check_phone_number("1123_343"))
print(check_phone_number("         "))
